from torch.optim.lr_scheduler import LambdaLR

class LambdaScheduler(LambdaLR):
    def __init__(self, optimizer, **kwargs):
        self.last_epoch = -1

        fn = lambda x: 0 if x<=7 else 1e-01

        super(LambdaScheduler, self).__init__(
            optimizer, fn, last_epoch=self.last_epoch, verbose=False
        )

